package crp.extensions.scy.repositories;

import crp.extensions.scy.models.SCYResourceSpaceEntity;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;

import javax.enterprise.context.ApplicationScoped;
import java.util.Optional;

import static io.quarkus.panache.common.Parameters.with;

@ApplicationScoped
public class SCYResourceSpaceRepository implements PanacheRepositoryBase<SCYResourceSpaceEntity, String> {
    public Optional<SCYResourceSpaceEntity> findByName(String name) {
        return find("spaceName=:name", with("name", name)).firstResultOptional();
    }

}
